1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to encoding audio signals, and more particularly, to encoding residual signals and decoding residual signals.
2. Description of the Related Art
With recent developments in digital technology, a technique of transforming analog audio signals into digital audio signals and transmitting the digital audio signals is being widely used in wired communications networks including an existing telephone network and mobile communications networks. Analog audio signals are transformed into digital audio signals by sampling. The digital audio signals are encoded and then transmitted. When the digital audio signals are encoded using a suitable encoding method, the transmission efficiency can greatly increase.
In general, when an audio signal is encoded and then decoded, the original audio signal is different from the decoded audio signal. A difference between an audio signal not yet encoded and an audio signal encoded and then decoded is referred to as a residual signal. For example, a linear predictive coding (LPC) model will now be described.
In the LPC model, an audio signal is divided into sections called frames. If N sampling operations are performed in a single frame, each frame has N sample values.
In the LPC model, a current sample value is obtained by summing previous sample values by using appropriate coefficients. The coefficients are the same within a frame. If an N-th sample value within a frame is S(N), S(N) can be expressed as a1*s(1)+a2*s(2)+ . . . +an−1s(N−1)+e(N), wherein e(N) corresponds to a residual signal.
When the LPC model is used, not only the audio signal but also the residual signal needs to be encoded and transmitted. However, in general, many bits are not allocated during encoding of a residual signal. In particular, a residual signal is divided into frames of the same size regardless of a change in the residual signal and then encoded. This encoding is not bad when the residual signal slightly changes within a frame. However, when the residual signal greatly changes within a frame, the quality of sound greatly degrades.
FIGS. 1A, 1B, and 1C illustrate an example where a residual signal is encoded and decoded according to a related art technique.
FIG. 1A illustrates a residual signal that is not yet encoded. The residual signal is divided into frames of the same size and then encoded. As illustrated in FIG. 1A, the residual signal greatly changes within a transient section 110.
FIG. 1B illustrates an average energy of the residual signal in each frame.
An average energy of a sampled signal is calculated by
                                          ∑                          n              -              1                        N                    ⁢                      (                                          s                2                            ⁡                              (                n                )                                      )                          ,                    Equation      and is encoded to serve as a representative value of a corresponding frame.
FIG. 1C illustrates a residual signal that has been encoded and decoded. A decoding unit (not shown) decodes the residual signal by using the average energy values of the residual signal in each frame. Referring to FIG. 1C, almost the original residual signal is restored from a frame of the residual signal that has slightly changed, but the original residual signal is not restored in a transient section 110 where the residual signal has greatly changed. When the residual signal slightly changes within a frame, the original signal can be suitably represented by a single representative value of the frame. However, when the residual signal greatly changes within a frame, as in the transient section 110, it is impossible to accurately represent the original signal by a single representative value of the frame.
As described above, in a conventional encoding method, a residual signal is divided into frames of the same size and then encoded, and thus the residual signal cannot be properly restored from a frame of the residual signal that has greatly changed because a sufficient number of bits are not allocated to the encoding of the residual signal. Therefore, the performance of encoding drastically degrades. In particular, in a transient section where the residual signal greatly changes, the quality of sound is greatly deteriorated as compared with a signal that is not yet encoded.